define(["../logic/templatelist", "../common/common"], function (pluginClass, c) {
    var size = {width: 248, height: 137};
    return {
        pluginClass: pluginClass,
        style: {
            backgroundColor: c.bodyColor
        },
        nocache: true,
        root: ["mainvlayout"],
        components: {
            mainvlayout: {
                type: "vbox",
                style: {
                    height: "100%",
                    width: "100%",
                    backgroundColor:"#f5f5f5"
                },
                items: [
                    {
                        root: ["main_header"],
                        style: {
                            height: "57px"
                        }
                    },

                    {
                        root: ["main_body"],
                        style: {}
                    }, {
                        root: ["paginator"],
                        style: {
                            height: 70
                        }
                    }
                ]
            },

            main_header: {
                type: "hbox",
                className: "yy-unselect",
                style: {
                    background: "#fff",
                    borderBottom: "1px solid #eee",
                    height: "100%",
                    width: "100%",
                    paddingRight: "20px"
                },
                items: [
                    {
                        root: ["title"],
                        style: {
                            verticalAlign: "middle",
                        }
                    },
                    {
                        root: [],
                        style: {
                            textAlign: "right",
                            verticalAlign: "middle",
                            width: "230px"
                        }
                    }
                ]
            },
            title: c.getTitle("日志模板"),
            main_body: {
                type: "view",
                style: {
                    width: "100%",
                    height: "100%",
                    overflow: "hidden",
                    padding: "14px 15px"
                },
                root: ["main_body_inner"]
            },
            main_body_inner: {
                type: "view",
                style: {
                    height: "100%",
                    overflow: "auto"
                },
                root: ["repeat"]
            },
            paginator: {
                type: "paginator",
                ref: true
            },
            repeat: {
                ref: true,
                type: "repeat",
                subComponentInBefore: true,
                subComponent: "subComponent",
                root: ["repeat_item_wrap"],
                style: {
                    overflow: "hidden",
                    transition: "all 450ms ease-in 0ms"
                },
                itemStyle: {
                    float: "left",
                    marginBottom: 10,
                    marginRight: 10,
                    transition: "all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms"
                }
            },
            subComponent: {
                type: "view",
                className: "subComponent_btn",
                style: {
                    width: size.width,
                    cursor: "pointer",
                    float: "left",
                    marginRight: 10,
                    marginBottom: 10,
                    transition: "all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",
                    boxShadow: "rgba(0, 0, 0, 0.13) 0px 4px 10px",
                    borderRadius: "4px",
                    backgroundColor: "white",
                    height: size.height
                },
                root: ["subComponent_top", "subComponent_bottom"]
            },
            subComponent_top: {
                type: "icon",
                font: "icomoon_e901",
                className: "",
                style: {
                    fontSize: "16px",
                    color: "#fff",
                    padding: "9px 10px",
                    margin: "36px auto 12px auto",
                    borderRadius: "40px",
                    backgroundColor: "#1FDA9A",
                    boxShadow: "rgba(0, 0, 0, 0.13) 0px 2px 3px",
                    lineHeight: "1",
                    transition: "all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",
                }
            },
            subComponent_bottom: {
                type: "text",
                text: "创建模板",
                className: "",
                style: {
                    textAlign: "center",
                    color: "#999",
                    fontSize: "14px",
                    transition: "all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",
                }
            },
            repeat_item_wrap: {
                type: "view",
                className: "template-list-item",
                style: {
                    width: size.width,
                    paddingTop: "22px",
                    backgroundColor: "white",
                    cursor: "pointer",
                    transition: "all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms",
                    boxShadow: "rgba(0, 0, 0, 0.13) 0px 4px 10px",
                    borderRadius: "4px",
                    overflow:"hidden",
                    height: size.height
                },
                root: ["repeat_item_top", "repeat_item_time", "repeat_item_content", "item_stop_btnGroup", "item_normal_btnGroup"]
            },
            repeat_item_top: {
                type: "view",
                root: ["item_top_title", "item_top_status"]
            },
            item_top_title: {
                type: "text",
                defaultText: "This is title",
                style: {
                    maxWidth: "170px",
                    wordWrap: "breakWord",
                    whiteSpace: "nowrap",
                    textOverflow: "ellipsis",
                    overflow: "hidden",
                    fontSize: "16px",
                    color: "#666666",
                    marginLeft: "15px"
                },
                text_bind: "title"
            },
            item_top_status: {
                type: "text",
                text: "已停用",
                className: "item-status",
                style: {
                    fontSize: "12px",
                    position: "absolute",
                    top: "0px",
                    right: "15px",
                    padding: "1px 5px",
                    borderRadius: "10px",
                    color: "#FF6873",
                    backgroundColor: "#FFF0F2",
                    marginTop: "2px"
                },
            },
            repeat_item_time: {
                type: "text",
                style: {
                    fontSize: "12px",
                    color: "#CCCCCC",
                    marginLeft: "15px"
                },
                text_bind: "createTime"
            },
            repeat_item_content: {
                type: "text",
                text: "用户体验部成员周报模板用户设置什么的",
                style: {
                    fontSize: "14px",
                    color: "#999999",
                    marginLeft: "15px",
                    whiteSpace: "nowrap",
                    overflow: "hidden",
                    height: "31px",
                    paddingRight: "10px",
                    textOverflow: "ellipsis",
                    paddingTop: "10px"
                },
                text_bind: "describe"
            },
            item_stop_btnGroup: {
                type: "view",
                className: "stop-btn-group",
                style: {
                    display: "flex",
                    justifyContent: "space-around"
                },
                root: ["start_icon", "edit_icon", "delete_icon"]
            },
            start_icon: {
                type: "icon",
                text: "启用",
                textStyle: {marginLeft: 3, fontSize: "14px", color: "#666666", paddingTop: "4px"},
                style: {
                    display: "inline-block",
                    verticalAlign: "middle",
                    color: "#aaaaaa"
                },
                font: "icomoon_e91a"
            },
            edit_icon: {
                type: "icon",
                text: "编辑",
                textStyle: {marginLeft: 3, fontSize: "14px", color: "#666666", paddingTop: "4px"},
                style: {
                    display: "inline-block",
                    verticalAlign: "middle",
                    color: "#aaaaaa"
                },
                font: "icomoon_e914"
            },
            delete_icon: {
                type: "icon",
                text: "删除",
                textStyle: {marginLeft: 3, fontSize: "14px", color: "#666666", paddingTop: "4px"},
                style: {
                    display: "inline-block",
                    verticalAlign: "middle",
                    color: "#aaaaaa"
                },
                font: "icomoon_e913"
            },
            item_normal_btnGroup: {
                type: "view",
                className: "normal-btn-group",
                style: {},
                root: ["stop_icon", "read_icon"]
            },
            stop_icon: {
                type: "icon",
                text: "停用",
                textStyle: {marginLeft: 3, fontSize: "14px", color: "#666666", paddingTop: "4px"},
                style: {
                    position: "absolute",
                    top: "0px",
                    right: "40%",
                    verticalAlign: "middle",
                    color: "#aaaaaa"
                },
                font: "icomoon_e909"
            },
            read_icon: {
                type: "icon",
                text: "查看",
                textStyle: {marginLeft: 3, fontSize: "14px", color: "#666666", paddingTop: "4px"},
                style: {
                    position: "absolute",
                    top: "0px",
                    right: "15px",
                    verticalAlign: "middle",
                    color: "#aaaaaa"
                },
                font: "icomoon_e915"
            },

            del_dialog: {
                type: 'view',
                style: {
                    backgroundColor: "#fff",
                    overflow: "hidden",
                    borderRadius: "4px",
                    width: "300px",
                    height:"165px",
                    paddingTop: "44px",
                    paddingBottom: "10px",
                    margin: "auto"
                },
                root: ["del_dialog_label", "del_dialog_btn_wrap"]
            },
            del_dialog_label: {
                type: "text",
                style: {
                    textAlign: "center",
                    fontSize: "16px",
                    color: "#666666"
                },
                text: "确定要删除吗？"
            },
            del_dialog_btn_wrap: {
                type: "view",
                style: {
                    marginTop: "28px",
                    textAlign: "center"
                },
                root: ["del_dialog_cancelbtn", "del_dialog_okbtn"]
            },
            del_dialog_cancelbtn: {
                type: 'button',
                mode: 1,
                style: {
                    width: "80px",
                    height: "32px",
                    lineHeight: "32px",
                    border: "1px solid #eeeeee",
                    color: "#666666",
                    fontSize: "14px"
                },
                title: "取消"
            },
            del_dialog_okbtn: {
                type: 'button',
                mode: 2,
                ref: true,
                style: {
                    width: "80px",
                    height: "32px",
                    lineHeight: "32px",
                    backgroundColor: "#1FDA9A",
                    fontSize: "14px",
                    marginLeft: "20px"
                },
                title: "确定"
            },


        }
    };
});
